package controller.user;


import Message.Result;
import Message.vo.CategoryVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.CategoryRelatedService;

import java.util.List;

@RestController("userCategoryController")
@Slf4j
@RequestMapping("/user/category")
public class CategoryController {

    @Autowired
    CategoryRelatedService categoryRelatedService;

    @GetMapping("/list")
    public Result getCategoryList(Integer type) {

            
            List<CategoryVO> categoryVO = categoryRelatedService.getCategoryList(type);
            log.info("查询结果，categoryVO:{}", categoryVO);
            
            return Result.success(categoryVO);

        }
    }






